/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.miami.unix_storage.xmlinventory;

import javax.swing.JOptionPane;
import javax.swing.JTree;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import java.util.Properties;
import java.io.File;
import java.io.FileFilter;
import sun.awt.resources.awt;
/**
 *
 * @author Alex Lorenzo
 * "alexl@miami.edu"
 * 786-229-3229
 * Unix and Storage
 * 
 */
public class XMLGui extends javax.swing.JFrame {

    /**
     * Creates new form XMLGui
     */
    public XMLGui() {
        initComponents();
        setTitle("Unix Storage Group XML Inventory Generator/Reader");
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jFileNewChooser = new javax.swing.JFileChooser();
        jMenuBar1 = new javax.swing.JMenuBar();
        jFile = new javax.swing.JMenu();
        jFileNew = new javax.swing.JMenuItem();
        jFileOpen = new javax.swing.JMenuItem();
        jFileExit = new javax.swing.JMenuItem();
        jEdit = new javax.swing.JMenu();
        jEditCut = new javax.swing.JMenuItem();
        jEditCopy = new javax.swing.JMenuItem();
        jEditPaste = new javax.swing.JMenuItem();
        jAbout = new javax.swing.JMenu();
        jAboutInfo = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jFile.setText("File");

        jFileNew.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N, java.awt.event.InputEvent.CTRL_MASK));
        jFileNew.setText("New");
        jFileNew.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jFileNewActionPerformed(evt);
            }
        });
        jFile.add(jFileNew);

        jFileOpen.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, java.awt.event.InputEvent.CTRL_MASK));
        jFileOpen.setText("Open");
        jFileOpen.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jFileOpenActionPerformed(evt);
            }
        });
        jFile.add(jFileOpen);

        jFileExit.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Q, java.awt.event.InputEvent.CTRL_MASK));
        jFileExit.setText("Exit");
        jFileExit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jFileExitActionPerformed(evt);
            }
        });
        jFile.add(jFileExit);

        jMenuBar1.add(jFile);

        jEdit.setText("Edit");

        jEditCut.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_K, java.awt.event.InputEvent.CTRL_MASK));
        jEditCut.setText("Cut");
        jEditCut.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jEditCutActionPerformed(evt);
            }
        });
        jEdit.add(jEditCut);

        jEditCopy.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.CTRL_MASK));
        jEditCopy.setText("Copy");
        jEdit.add(jEditCopy);

        jEditPaste.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_V, java.awt.event.InputEvent.CTRL_MASK));
        jEditPaste.setText("Paste");
        jEdit.add(jEditPaste);

        jMenuBar1.add(jEdit);

        jAbout.setText("About");

        jAboutInfo.setText("Info");
        jAboutInfo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jAboutInfoActionPerformed(evt);
            }
        });
        jAbout.add(jAboutInfo);

        jMenuBar1.add(jAbout);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 635, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 546, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jEditCutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jEditCutActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jEditCutActionPerformed

    private void jFileExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jFileExitActionPerformed
        System.exit(0);
    }//GEN-LAST:event_jFileExitActionPerformed

    private void jAboutInfoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jAboutInfoActionPerformed
        JOptionPane.showMessageDialog(null, 
                "This Application was developed "
                + "for the University of Miami's Unix` Storage Group.\n"
                + "It is used for Creating XML "
                + "files for Virtual Machine and Physical Infrastructure\n"
                + "inventory. It's only purpose is to create, or append to "
                + "an XML doc.\n"
                + "Alex Lorenzo.");
    }//GEN-LAST:event_jAboutInfoActionPerformed

    private void jFileNewActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jFileNewActionPerformed
        jFileNewChooser.showOpenDialog(null);
        File fileDirectory = jFileNewChooser.getCurrentDirectory();
        StringBuilder filetocreate = new StringBuilder();
        String directorystring = fileDirectory.toString();
        filetocreate.append(directorystring);
        System.out.println(filetocreate.toString());
        
    }//GEN-LAST:event_jFileNewActionPerformed

    private void jFileOpenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jFileOpenActionPerformed
        jFileNewChooser.showOpenDialog(null);
        File filestoshow = jFileNewChooser.getSelectedFile();
      
    }//GEN-LAST:event_jFileOpenActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(XMLGui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(XMLGui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(XMLGui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(XMLGui.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new XMLGui().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenu jAbout;
    private javax.swing.JMenuItem jAboutInfo;
    private javax.swing.JMenu jEdit;
    private javax.swing.JMenuItem jEditCopy;
    private javax.swing.JMenuItem jEditCut;
    private javax.swing.JMenuItem jEditPaste;
    private javax.swing.JMenu jFile;
    private javax.swing.JMenuItem jFileExit;
    private javax.swing.JMenuItem jFileNew;
    private javax.swing.JFileChooser jFileNewChooser;
    private javax.swing.JMenuItem jFileOpen;
    private javax.swing.JMenuBar jMenuBar1;
    // End of variables declaration//GEN-END:variables
}
